package com.hc.concurrent_likes.event;

import com.alibaba.fastjson.JSONObject;
import com.hc.concurrent_likes.entity.Event;
import com.hc.concurrent_likes.entity.MoodDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

@Component
public class MoodProducer {

    @Autowired
    private KafkaTemplate kafkaTemplate;

    public void frieMoodEvent(Event event){
        kafkaTemplate.send(event.getTopic(), JSONObject.toJSONString(event));
    }

}
